/*******************************************************************************
 * Copyright (c) 2010, 2030 www.itlaobing.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.web.servlet;/**
 * Created by asus-pc on 2017/11/14 0014.
 */

import cn.itlaobing.dao.BaseDao;
import cn.itlaobing.dao.GoodsDao;
import cn.itlaobing.entity.GoodsDTO;
import cn.itlaobing.web.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

/**
 * ClassName: HomeServlet <br/>
 * Function: TODO 功能描述 <br/>
 * date: 2017/11/14 0014 10:03 <br/>
 *
 * @author 卖姑娘的小柴火
 * @since JDK 1.8
 */
@WebServlet("/servlet/*")
public class HomeServlet extends BaseServlet {
    @RequestMapping("/index")
    protected void index(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.sendRedirect(req.getContextPath()+"/goods/show");
    }
    @RequestMapping("/reg")
    protected void reg(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
       toView(req,resp,"/members/register");
    }
    @RequestMapping("/login")
    protected void login(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        toView(req,resp,"/members/login");
    }




    }

